﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Text;
using TianShu.TenantManagement.Dal.Abstracts.Entities;

namespace TianShu.TenantManagement.Service.TenantManagement.AutoMapperConfig
{
    public class TenantManagementProfile : Profile
    {
        public TenantManagementProfile()
        {

            CreateMap<TenantEntity, TenantDto>()
                .MapExtraProperties();
            CreateMap<TenantCreateDto, TenantEntity>()
                .MapExtraProperties()
            .ForMember(e => e.CreationTime, opt => opt.Ignore())
            .ForMember(e => e.CreatorId, opt => opt.Ignore())
            .ForMember(e => e.LastModificationTime, opt => opt.Ignore())
            .ForMember(e => e.LastModifierId, opt => opt.Ignore())
            .ForMember(e => e.DeleterId, opt => opt.Ignore())
            .ForMember(e => e.DeletionTime, opt => opt.Ignore())
            .ForMember(e => e.IsDeleted, opt => opt.Ignore())
            //.ForMember(e => e.ConcurrencyStamp, opt => opt.Ignore())
            .ForMember(e => e.ConnectionStrings, opt => opt.Ignore())
            .ForMember(e => e.Id, opt => opt.Ignore());

            CreateMap<TenantUpdateDto, TenantEntity>()
                .MapExtraProperties()
            .ForMember(e => e.CreationTime, opt => opt.Ignore())
            .ForMember(e => e.CreatorId, opt => opt.Ignore())
            .ForMember(e => e.LastModificationTime, opt => opt.Ignore())
            .ForMember(e => e.LastModifierId, opt => opt.Ignore())
            .ForMember(e => e.DeleterId, opt => opt.Ignore())
            .ForMember(e => e.DeletionTime, opt => opt.Ignore())
            .ForMember(e => e.IsDeleted, opt => opt.Ignore())
            //.ForMember(e => e.ConcurrencyStamp, opt => opt.Ignore())
            .ForMember(e => e.ConnectionStrings, opt => opt.Ignore())
            .ForMember(e => e.Id, opt => opt.Ignore());
        }
    }
}
